var mapData = createMapData();
 	
var canvas2 = document.createElement('canvas');
	
var update = function () {

	
		
	var canvas = document.getElementById("battlefieldCanvas");
	if (canvas.getContext) {
	
		var context = canvas.getContext("2d");
		context.setTransform(1, 0, 0, 1, 0, 0);
		context.clearRect(0, 0, canvas.width, canvas.height);
		context.translate(0, 0);
		context.scale(1, 1);
		drawMap(context, mapData);

		context.beginPath();
		context.arc(300, 300, 20, 0, 2 * Math.PI, false);
		context.fillStyle = 'green';
		context.fill();
		
		context.save();
				 
		context.globalCompositeOperation = 'destination-atop';

		context.beginPath();  
		var // Radii of the white glow.         
		innerRadius = 0,           
		outerRadius = 800,               
		// Radius of the entire circle.         
		radius = 900;     
		var gradient = context.createRadialGradient(400, 400, innerRadius, 400, 400, outerRadius);  
		gradient.addColorStop(0, 'rgba(255, 255, 255, 1.0)');  
		gradient.addColorStop(1, 'rgba(255, 255, 255, 0)');  
		context.arc(0, 0, radius, 0, 2 * Math.PI);    
		context.fillStyle = gradient;  
		context.fill(); 

		context.restore();
	}
};
 
setInterval(update, 100); 